package com.ny.zmb.openapi.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ny.zmb.openapi.controller.entity.Result;
import com.ny.zmb.openapi.entity.PmRegister;
import com.ny.zmb.openapi.mapper.PmRegisterMapper;
import com.ny.zmb.openapi.ysutil.from.BizReqJsonCollege.UploadDocumentReqCommandPlus;
import com.ny.zmb.openapi.ysutil.utils.YsChannelClientException;
import org.springframework.web.multipart.MultipartFile;

/**
 * 进件
 *
 * @author ChenZhiZheng
 * @date 20241108
 */
public interface PmRegisterService extends IService<PmRegister> {

    /**
     * 任意API
     *
     * @param obj
     * @param srcMerchantNo
     * @param methodStr
     * @param userId
     * @return
     * @throws YsChannelClientException
     */
    /**
     * 进件资料上传 更新进件资料和审核表
     *
     * @param obj 对象
     * @return 返回体
     */
    Result infoUpdate(JSONObject obj, Integer userId) throws YsChannelClientException;

    /**
     * 提交审核
     *
     * @param jsonObject
     * @param userId
     * @return
     */
    Result commitInfoToZMB(JSONObject jsonObject, Integer userId);

    /**
     * 状态变更
     *
     * @param jsonObject
     * @return
     */
    Result changeStatus(JSONObject jsonObject);

    /**
     * 提交申请到银盛审核
     *
     * @param jsonObject
     * @param srcMerchantNo
     * @return
     */
    Result commitToYs(JSONObject jsonObject, String srcMerchantNo);


    /**
     * 该接口可用于查询商户进件的结果、商户信息、商户状态等
     *
     * @param obj
     * @param srcMerchantNo
     * @return
     */
    Object queryMerchant(JSONObject obj, String srcMerchantNo);

    PmRegister getInfoByOutMerchantNo(String outMerchantNo);

    boolean registerForFileUpdate(Integer userId, UploadDocumentReqCommandPlus obj, String ysPath);



    void registerSuccess(JSONObject merchantInfo);

    String fileUploadForOss(MultipartFile file, String name);
    String ossUpload(MultipartFile file, String name,String path);

    String filePathUploadForYs(MultipartFile file, String path, UploadDocumentReqCommandPlus obj);

    Boolean updateMerchantNoByOutMerchantNo(String outMerchantNo, String merchantNo);

    PmRegister getInfoByUserId(Integer userId);

}
